package com.itheima.exception;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class BusinessException extends RuntimeException {
    private Integer code; // 自定义错误码
    private String message; // 错误信息

    public BusinessException(String message) {
        super(message);
        this.message = message;
        this.code = 1; // 默认错误码，可以根据需要调整
    }

    public BusinessException(Integer code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }
}
